import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;

public class Test {
    public static void main(String[] args) {
        //双端队列
        Deque<Integer> deque = new LinkedList<>();
        deque.offer(1);
        Deque<Integer> stack = new LinkedList<>();
        stack.push(-1);


    }


    public static void main2(String[] args) {
        //队列的模拟实现
        MyQueue myQueue = new MyQueue();
        myQueue.offer(1);
        myQueue.offer(2);
        myQueue.offer(3);
        myQueue.offer(4);

        int val = myQueue.poll();
        System.out.println(val);

        int val1 = myQueue.peek();
        System.out.println(val1);

        int val3 = myQueue.getUsedSize();
        System.out.println(val3);
    }


    public static void main1(String[] args) {
        //队列先进先出
        Queue<Integer> queue = new LinkedList<>();
        //入队列
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        //出队列(删除)
        int val = queue.poll();
        System.out.println(val);
        //获取队列头的元素
        int val2 = queue.peek();
        System.out.println(val2);

        //获取队列中有效元素的个数
        int val3 = queue.size();
        System.out.println(val3);

        //检测队列是否为空
        System.out.println(queue.isEmpty());
    }
}
